package com.dx.architectureddd.app.chain.init;

import com.dx.architectureddd.common.dp.pipeline.ContextHandler;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * 场景初始化
 *
 * @author xin.deng
 * @date 2023/09/24
 */
@Slf4j
@Component
public class SceneInit implements ContextHandler<InitContext> {
    @Override
    public boolean handle(InitContext context) {
        Map<String, Object> inPut = context.getInPut();
        String scene = (String) inPut.get("scene");
        return StringUtils.isNotBlank(scene);
    }
}
